package com.coco.controller;

import com.coco.dao.MsgMapper;
import com.coco.entity.Msg;
import com.coco.service.TranctionService;
import org.apache.ibatis.type.JdbcType;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class MsgController {


    @Autowired
    private MsgMapper msgMapper;

    @RequestMapping("/addMsg")
    public String addMsg() {
        Msg msg = new Msg();
        msg.setId(2);
        msgMapper.addMsg(msg);
        return "success";
    }

    @RequestMapping("/getData")
    public Object getData() {
        return msgMapper.getData();
    }

    @Autowired
    private TranctionService tranctionService;

    @RequestMapping("save")
    public String save() {
        tranctionService.save();
        return "success";
    }
}
